<?php
/**
 * Отправка сообщения.
 */
class Users_Helper_Mail extends Zend_Controller_Action_Helper_Abstract {
	/**
	 * @param string|array $mAddress
	 * @param string $sTemplateName
	 * @param array $aParams
	 */
	function direct($mAddress,$sTemplateName,$aParams) {
		$modulePath = $this->getFrontController()->getModuleDirectory();
		var_dump($modulePath);
		$mAddress = (array)$mAddress;
		$aParams = (array)$aParams;
        /** @var Zend_Controller_Request_Http $oRequest */
        $oRequest = $this->getFrontController()->getRequest();

		foreach ($mAddress as $sAddress) {
			$mail = new Workset_Mail('utf-8', array('host' => $oRequest->getHttpHost()));

			$mail->setRecipient($sAddress);
			$mail->setTemplatePath($modulePath.'/views/emails/');
			$mail->setTemplate($sTemplateName);
			$mail->send($aParams);
		}
	}
}
?>